package com.comtop.topcloud.device.controller;

import com.comtop.topcloud.device.model.influxdb.DeviceReportingDataModel;
import com.comtop.topcloud.device.model.influxdb.DeviceReportingDataParamModel;
import com.comtop.topcloud.device.service.DeviceReportingDataService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("iotData")
public class DeviceReportingDataController {

       @Resource
       private DeviceReportingDataService deviceReportingDataService;

       @PostMapping("buildQuery")
       public List<DeviceReportingDataModel>   buildQuery(DeviceReportingDataParamModel params){
              return    deviceReportingDataService.buildQuery(params);
       }

       @PostMapping("selectOne")
       public DeviceReportingDataModel  selectOne(DeviceReportingDataParamModel params){
              return    deviceReportingDataService.selectOne(params);
       }

}
